package com.atguigu.demo.customer.service.impl;

import com.atguigu.demo.customer.bean.Customer;
import com.atguigu.demo.customer.mapper.CustomerMapper;
import com.atguigu.demo.customer.service.CustomerService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DS("mysql0425")
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> implements CustomerService   {

    @Autowired
    CustomerMapper customerMapper;

    @Override
    public Customer getCustomerById(String id) {
        return customerMapper.getCustomerById(id);
    }

    @Override
    @DS("mysql0425")
    public void saveCustomer(Customer customer) {
        customerMapper.insert(customer);
    }
}
